package cn.changein.framework.context;

import cn.changein.framework.request.RequestData;

/**
 * <p>
 *     请求数据的临时容器
 * </p>
 *

 * @Date: 2020-10-27 15:16
 * @Copyright: companyName
 * @Version 1.0
 * @Since JDK1.8
 */
public class RequestDataHolder {

    private static ThreadLocal<RequestData> holder = new ThreadLocal<>();

    public static void put(RequestData s) {
        if (holder.get() == null) {
            holder.set(s);
        }
    }

    public static RequestData get() {
        return holder.get();
    }

    public static void remove() {
        holder.remove();
    }
}
